package cn.zswltech.gruul.common.dto;

import cn.zswltech.gruul.common.util.ObjectUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Jim
 * @version 1.0.0
 * @descripition:
 * @date 2024/3/20 15:39
 */
@Data
@Accessors(chain = true)
public class RoleMenuResourceRSP {

    private List<SingleResource> resourceList;

    @Data
    @Accessors(chain = true)
    public static class SingleResource{
        // 资源包名称
        String resourceCode;
        // 资源包名称
        String resourceName;
        // 资源包下的菜单集合
        List<ResourceViewRSP.SingleMenu> menuList;
    }

    /**
     * 添加资源
     * @param singleResource
     */
    public void add(RoleMenuResourceRSP.SingleResource singleResource){
        if (null == resourceList){
            resourceList = new ArrayList<>();
        }
        resourceList.add(singleResource);
    }



}
